package com.zzw.hj81;

import java.util.Scanner;

/**
 * @Project: hw_java
 * @Description: 字符串字符匹配
 * @Author: zzw
 */
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static boolean isExitsChar(String shorStr, String longStr) {
        int[] bucket = new int[128];
        for (int i = 0; i < longStr.length(); i++) {
            // 统计长字符串各个字符出现的频率
            bucket[longStr.charAt(i)]++;
        }
        for (int i = 0; i < shorStr.length(); i++) {
            // 短字符串在长字符串中各个字符的频率
            if (bucket[shorStr.charAt(i)] == 0) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextLine()) {
            String shortStr = in.nextLine();
            String longStr = in.nextLine();
            System.out.println(isExitsChar(shortStr, longStr));
        }
    }
}